package com.bestcem.xm.ticket.service.dto.ticket.flow;

import com.bestcem.xm.ticket.entity.mongo.TicketFlow;
import com.bestcem.xm.ticket.entity.mongo.TicketRule;
import com.bestcem.xm.ticket.enums.TicketFlowMatchConditionEnum;
import com.bestcem.xm.ticket.enums.TicketFlowStatusEnum;
import com.bestcem.xm.ticket.service.dto.ticket.rule.RuleDTO;
import lombok.Data;
import lombok.ToString;

import java.util.List;

/**
 * @author liheng
 * @version v1.0
 * @date 2021/8/20 13:36
 */
@Data
public class InsertFlowDTO {


    /**
     * orgId
     */
    private String orgId;

    /**
     * userId
     */
    private String userId;

    /**
     * ticketConfigId
     */
    private String ticketConfigId;

    /**
     * flowId 工单流程序列号
     */
    private Integer flowId;

    /**
     * title
     */
    private String title;

    /**
     * status
     *
     * @see TicketFlowStatusEnum
     */
    private Integer status;

    /**
     * matchCondition
     *
     * @see TicketFlowMatchConditionEnum
     */
    private Integer matchCondition;

    /**
     * alertRuleIds ObjectId 数组
     */
    private List<String> alertRuleIds;

    /**
     * customRuleIds
     */
    private List<TicketFlow.CustomRuleId> customRuleIds;

    /**
     * priority 工单流程的优先级 数字越小优先级越高
     */
    private Integer priority;

    /**
     * 保存每个跟进人的详细配置, 注意数组内元素的顺序, 第一个元素就是第一跟进人, 第二个就是第二跟进人, 最多两个跟进人
     */
    private List<TicketFlow.FollowConfig> followConfig;

    /**
     * needAudit
     */
    private Boolean needAudit;

    /**
     * auditConfig
     * 补充: @刘广云: 复制样类代码显示它是FollowConfig类型
     */
    private List<TicketFlow.FollowConfig> auditConfig;

    /**
     * version
     */
    private Integer version;

    /**
     * 工单流程规则id列表（当前已无该字段）
     */
    private List<String> ruleList;

    /**
     * 工单规则列表
     */
    private List<RuleDTO> ruleDtoS;

    @Data
    @ToString
    public static class RuleList {
        private String id;

        private String title;

        private Integer status;

        private Integer logic;

        private Boolean deleted;

        private List<TicketRule.Condition> conditionList;

        private List<TicketRule.Target> targetList;


    }
}
